import { defHttp } from '@/utils/http/axios';
import { ID, IDS } from '@/api/base';
import { BraceletVO, BraceletForm, BraceletQuery } from './model';
/**
 * 查询手环信息列表
 * @param params
 * @returns
 */
export function braceletList(params?: BraceletQuery) {
  return defHttp.get<BraceletVO[]>({ url: '/bracelet/manage/list', params });
}

/**
 * 导出手环信息列表
 * @param params
 * @returns
 */
export function braceletExport(params?: BraceletQuery) {
  return defHttp.post<Blob>(
    { url: '/bracelet/manage/export/all', params, responseType: 'blob' },
    { isTransformResponse: false },
  );
}

/**
 * 手环信息生成
 * @param params
 * @returns
 */
export function braceletCreate(params?: BraceletForm) {
  return defHttp.post<Blob>(
    { url: '/bracelet/manage/export', params, responseType: 'blob' },
    { isTransformResponse: false },
  );
}

/**
 * 查询手环信息详细
 * @param id id
 * @returns
 */
export function braceletInfo(id: ID) {
  return defHttp.get<BraceletVO>({ url: '/biz/bracelet/' + id });
}

/**
 * 新增手环信息
 * @param data
 * @returns
 */
export function braceletAdd(data: BraceletForm) {
  return defHttp.postWithMsg<void>({ url: '/biz/bracelet', data });
}

/**
 * 更新手环信息
 * @param data
 * @returns
 */
export function braceletUpdate(data: BraceletForm) {
  return defHttp.putWithMsg<void>({ url: '/biz/bracelet', data });
}

/**
 * 删除手环信息
 * @param id id
 * @returns
 */
export function braceletRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/biz/bracelet/' + id });
}
